1. Field of the Invention
The present invention relates to a floating-point data rounding and normalizing circuit, and more particularly to such a circuit capable of executing rounding, normalizing and overflow correction of a numerical data representative of two's complement in parallel at a high speed.
2. Description of Related Art
A floating-point representation can make the range of expressible numbers independent of the number of significant digits, and therefore, is widely used in data processing systems. However, a floating-point arithmetic operation needs a floating-point normalization. Namely, a floating-point arithmetic circuit must have a floating-point normalizing circuit. Conventionally, a typical floating-point normalizing circuit includes a comparator receiving two multi-bit numbers A and B to determine which is larger, A or B. This comparator controls a multiplexor which also receives the two input numbers A and B, so that the multiplexor outputs a larger one of the two input numbers to a shift and count circuit (SAC). This SAC circuit leftwardly shifts the input number until the shifted number has a nonzero leftmost digit, i.e., "1" at the most significant digit, and at the same time the SAC circuit counts the amount of the shift. Thus, the SAC circuit outputs the result of the count to an encoder, which is in turn converts the counted value into an exponent data in a floating-point representation. Further, the output of the SAC circuit is supplied to a pair of shifters which receive the input numbers A and B, respectively, so that the respective shifters shift the respective input numbers the same amount indicated by the SAC circuit.
The two numbers A and B thus shifted are outputted from the respective shifters to a processing unit, which in turn executes a designated arithmetic operation to the two input numbers so as to output the result of the arithmetic operation as a fraction or mantissa in a floating-point representation.
In the above mentioned normalization, to ensure sufficient precision, not only normalization but also rounding are required. Further, it is necessary to make correction on the basis of overflow caused in the rounding operation. However, the normalization, the rounding and the overflow correction involve complicated processings, which need either a long time of operation or a large amount of hardware. Particularly, in the case that a high speed operation, a required hardware will inevitably become extensive.
Specifically, a mantissa or fraction portion of an input floating-point data is checked by the shift and count (SAC) circuit so that a required amount of leftward shift is determined. The fraction portion of the input floating-point data is lefwardly shifted by the required amount designated by the SAC circuit. In a high speed operation, this leftward shift is parallel-processed by using a barrel shifter. On the other hand, the value corresponding the amount of leftward shift is subtracted from an exponent portion of the input floating-point data. If an underflow occurs in the exponent portion as the result of this subtraction, a necessary correction is made.
In a succeeding rounding operation, a less significant bit portion of the shifted fraction portion is cut away, so that a predetermined bit number of more significant bits is outputted. In this operation, if the most significant bit of the cut-away less significant bit portion is "1", "1" is added to the least significant bit of the fraction data composed of more significant bits. As the result of this addition, if an overflow occurs, the fraction data is shifted rightwardly one bit. Further, "1" is added to the exponent data, and if an overflow then occurs, a necessary correction is made.
The above mentioned normalizing and rounding operation for the floating-point data is executed by using a parallel wired-logic in a high speed operation unit. However, since the overflow correction must be executed on the basis of the result of the arithmetic operation, it has become a hindrance to a high speed operation, and also needs additional hardware. This is inconvenient to the speed-up of operation in the case that the system is constituted of a large scale integrated circuit.